<html>
<head>
    <title>风险识别</title>
    <link rel="stylesheet" href="../../../assets/theme-chalk/index.css">
    <link rel="stylesheet" href="../../../style.css">

    <script type='text/javascript' src='../../../assets/bundle.js' charset='utf-8'></script>
    <script type='text/javascript' src='../../../assets/jquery-1.11.2.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='../../../assets/echarts.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='../../../assets/jquery.qrcode.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='../../../js/common.js' charset='utf-8'></script>
    <script type='text/javascript' src='../../../js/component.js' charset='utf-8'></script>
    <style>
        body {
            background: #F0F2F6;
        }

        .main-head {
            background: #fff;
            padding-left: 10px;
            padding-top: 10px;
            margin-bottom: 0px;
            border: solid 1px #fff;
        }

        .chart-outer {
            height: 200px;
        }
        .risk_name{
            position: relative;
            text-align: center;
            color: #d73530;
            font-weight: bolder;
        }
        img {
            width: 30px;
            width: 32px;
        }

        td {
            text-align: center;
            height: 50px; /*这里需要自己调整，根据自己的需求调整高度*/
            position: relative;
        }

        td[class=first] {
            width: 100px;
        }

        td[class=first]:before {
            content: "";
            position: absolute;
            width: 1px;
            height: 160px;
            top: 0;
            left: 0;
            background-color: #000;
            display: block;
            transform: rotate(-73deg);
            transform-origin: top;
            -ms-transform: rotate(-73deg);
            -ms-transform-origin: top;
        }

        .title1 {
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .bgFull{
            background-size: cover;
        }
        .title2 {
            position: absolute;
            top: 26px;
            right: 70px;
        }

        .popClass {
            height: 300px;
            overflow: scroll;
        }

        .page-main {
            width: 100%;
        }
    </style>
</head>
<body>
<div class="page" id="page-monitor" style="display: none;width: 100%">
    <div class="page-title">风险管理 › 风险识别</div>
    <div class="page-main">

        <el-row>
            <el-col :span="24">
                <div class="main-head">
                    <el-form :inline="true" size="small" :model="searchForm">
                        <el-form-item label="风险点名称">
                            <el-input placeholder="风险点名称" v-model="searchForm.riskName"
                                      style="width: 150px;"></el-input>
                        </el-form-item>

                        <el-form-item label="风险点等级">
                            <el-select style="width: 150px;" v-model="searchForm.grade">
                                <el-option label="Ⅰ" value="1"></el-option>
                                <el-option label="Ⅱ" value="2"></el-option>
                                <el-option label="Ⅲ" value="3"></el-option>
                                <el-option label="Ⅳ" value="4"></el-option>
                            </el-select>
                        </el-form-item>

                        <el-form-item label="风险点状态">
                            <el-select style="width: 150px;" v-model="searchForm.useFlag">
                                <el-option value="1" label="已管控"></el-option>
                                <el-option value="0" label="未管控"></el-option>
                            </el-select>
                        </el-form-item>

                        <el-form-item label="风险点分类">
                            <el-select v-model="searchForm.riskType" style="width: 150px;">
                                <el-option label="设备" value="0"></el-option>
                                <el-option label="场所" value="1"></el-option>
                                <el-option label="作业" value="2"></el-option>
                            </el-select>
                        </el-form-item>

                        <el-form-item>
                            <el-button type="primary" @click="search">查询</el-button>
                            <el-button type="success" @click="addClick">新增</el-button>
                            <el-button type="warning" @click="export_All">导出研判清单</el-button>
                            <el-button type="danger" @click="handleModClick">模板中新增</el-button>
                            <el-button type="danger" @click="LECdowload">下载LEC模板</el-button>
                            <el-button type="danger" @click="LECfileUp">上传LEC风险</el-button>
                            <el-button type="danger" @click="LSdowload">下载LS模板</el-button>
                            <el-button type="danger" @click="LSfileUp">上传LS风险</el-button>
                            <el-button type="primary" @click="exportGrade">导出风险清单</el-button>
                            <el-button type="success" @click="OnekeyBtn(1)">一键管控</el-button>
                            <el-button type="success" @click="OnekeyBtn(0)">一键未管控</el-button>
                            <el-button type="success" @click="OnekeyCode()">一键打印二维码</el-button>
                        </el-form-item>
                    </el-form>
                </div>
            </el-col>
        </el-row>

        <el-row>
            <el-col :span="24">
                <el-table :data="tableData" :stripe="true" :border="true" size="mini" height="600"
                          style="width: 100%;margin-bottom: 50px">
                    <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
                    <el-table-column prop="riskName" label="风险点名称" align="center"></el-table-column>
                    <el-table-column prop="grade" label="风险等级" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.grade==1">
                                <img src="../../../imgs/onelevel.png">
                                <div align="center">重大风险</div>

                            </div>
                            <div v-if="scope.row.grade==2">
                                <img src="../../../imgs/twolevel.png">
                                <div align="center">较大风险</div>
                            </div>
                            <div v-if="scope.row.grade==3">
                                <img src="../../../imgs/threelevel.png">
                                <div align="center">一般风险</div>
                            </div>
                            <div v-if="scope.row.grade==4">
                                <img src="../../../imgs/fourlevel.png">
                                <div align="center">低风险</div>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="riskType" label="风险分类" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.riskType==0">
                                设备
                            </div>
                            <div v-if="scope.row.riskType==1">
                                场所
                            </div>
                            <div v-if="scope.row.riskType==2">
                                作业
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="LEC研判法" align="center">
                        <el-table-column prop="likelihood" label="可能性(L)" align="center">
                            <template slot-scope="scope">
                                {{likelihoodJson[scope.row.likelihood]}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="exposure" label="暴露程度(E)" align="center">
                            <template slot-scope="scope">
                                {{exposureJson[scope.row.exposure]}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="consequence" label="后果(C)" align="center">
                            <template slot-scope="scope">
                                {{consequenceJson[scope.row.consequence]}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="LecScore" label="危险性(D)" align="center">
                            <template slot-scope="scope">
                                <div v-if="scope.row.LecScore>=320">
                                    <img src="../../../imgs/onelevel.png">
                                    <div align="center">重大风险</div>
                                </div>
                                <div v-if="scope.row.LecScore>=160&&scope.row.LecScore<320">
                                    <img src="../../../imgs/twolevel.png">
                                    <div align="center">较大风险</div>
                                </div>
                                <div v-if="scope.row.LecScore>=70&&scope.row.LecScore<160">
                                    <img src="../../../imgs/threelevel.png">
                                    <div align="center">一般风险</div>
                                </div>
                                <div v-if="scope.row.LecScore>0&&scope.row.LecScore<70">
                                    <img src="../../../imgs/fourlevel.png">
                                    <div align="center">低风险</div>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table-column>
                    <el-table-column label="LS研判法" align="center">
                        <el-table-column prop="possible" label="事故发生可能性(L)" align="center">
                            <template slot-scope="scope">
                                {{possibleJson[scope.row.possible]}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="seriouse" label="事故后果严重性(S)" align="center">
                            <template slot-scope="scope">
                                {{seriouseJson[scope.row.seriouse]}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="lsScore" label="风险值(R)" align="center">
                            <template slot-scope="scope">
                                <div v-if="scope.row.lsScore > 19">
                                    <img src="../../../imgs/onelevel.png">
                                    <div align="center">重大风险</div>
                                </div>
                                <div v-if="scope.row.lsScore <19 && scope.row.lsScore >14 ">
                                    <img src="../../../imgs/twolevel.png">
                                    <div align="center">较大风险</div>
                                </div>
                                <div v-if="scope.row.lsScore <14 && scope.row.lsScore >7 ">
                                    <img src="../../../imgs/threelevel.png">
                                    <div align="center">一般风险</div>
                                </div>
                                <div v-if="scope.row.lsScore<7 && scope.row.lsScore >0">
                                    <img src="../../../imgs/fourlevel.png">
                                    <div align="center">低风险</div>
                                </div>
                                <div v-if="scope.row.lsScore==0">

                                </div>
                            </template>
                        </el-table-column>
                    </el-table-column>
                    <el-table-column prop="userName" label="负责人" align="center"></el-table-column>
                    <el-table-column prop="useFlag" label="管控状态" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.useFlag==0">
                                <el-button type="info" size="small" @click="statusBtn(scope.row,1)">未管控</el-button>
                            </div>
                            <div v-if="scope.row.useFlag==1">
                                <el-button type="warning" size="small" @click="statusBtn(scope.row,0)">已管控</el-button>
                            </div>
                        </template>
                    </el-table-column>


                    <el-table-column label="操作" align="center" width="480">
                        <template slot-scope="scope">
                            <el-button @click="handleClick(scope.row)" round size="mini" icon="el-icon-edit"
                                       type="success">编辑
                            </el-button>

                            <el-button @click="checkTask(scope.row)" round size="mini" icon="el-icon-search"
                                       type="info">详情
                            </el-button>
                            <el-button round icon="el-icon-setting" size="mini" @click="taskClick(scope.row)"
                                       type="primary">巡检任务
                            </el-button>
                            <el-button @click="showImg(scope.row)" round size="mini" icon="el-icon-picture"
                                       type="warning"></el-button>
                            <el-button type="success" icon="el-icon-share" size="mini" round
                                       @click="exportData(scope.row)"></el-button>
                            <el-button @click="delRisk(scope.row.Id)" round size="mini" icon="el-icon-delete"
                                       type="danger"></el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="page-footer">
                    <el-pagination background layout="prev, pager, next" :pagesize="pageSize" :total="totalCount"
                                   :current-page.sync="currentPage" @current-change="onChangePage">
                    </el-pagination>
                </div>
            </el-col>
        </el-row>


    </div>
    <el-row v-if="flag">

        <el-dialog title="模板中新增" :visible="modVisible" :show-close="false" :fullscreen="true" style="display: none">
            <el-form size="small" :model="modForm">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="风险点名称">
                            <el-input placeholder="风险点名称" v-model="modForm.riskName" style="width: 150px;"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="企业类型">
                            <el-select style="width: 150px;" v-model="modForm.cid">
                                <el-option
                                        v-for="item in businessType"
                                        :key="item.cid"
                                        :label="item.cname"
                                        :value="item.cid">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item>
                            <el-button type="primary" @click="modSearch">查询</el-button>
                        </el-form-item>
                    </el-col>

                </el-row>
            </el-form>
            <table align="center" border="1" cellspacing="0" cellpadding="10">
                <tr>
                    <td>操作</td>
                    <td>行业分类</td>
                    <td>风险点类型</td>
                    <td>风险点名称</td>
                    <td>风险内容</td>
                    <td>导致事故的原因</td>
                    <td>可能导致的事故</td>
                    <td style="min-width: 80px">影响范围</td>
                    <td style="min-width: 80px">潜在后果</td>
                </tr>
                <template v-for="(item,index) in modData" :key="index">
                    <tr>
                        <td :rowspan="item.TitleData.length+1">
                            <el-button type="success" @click="selectMod(index)">研判</el-button>
                        </td>
                        <td :rowspan="item.TitleData.length+1">
                            {{item.TitleData[0].cname}}
                        </td>
                        <td :rowspan="item.TitleData.length+1">
                            <template v-if="item.TitleData[0].riskType==0">
                                设备
                            </template>
                            <template v-if="item.TitleData[0].riskType==1">
                                场所
                            </template>
                            <template v-if="item.TitleData[0].riskType==2">
                                作业
                            </template>
                        </td>
                        <td :rowspan="item.TitleData.length+1">{{item.RiskName}}</td>
                    </tr>
                    <template v-for="temp in item.TitleData" :key="item.Id">
                        <tr>
                            <td>{{temp.title}}</td>
                            <td>{{temp.reason}}</td>
                            <td>{{temp.damageType}}</td>
                            <td>
                                <template v-if="temp.scope==0">
                                    本厂
                                </template>
                                <template v-if="temp.scope==1">
                                    作业场所
                                </template>
                                <template v-if="temp.scope==2">
                                    设备
                                </template>
                            </td>
                            <td>{{temp.damage}}</td>
                        </tr>
                    </template>
                </template>
            </table>

            <span slot="footer" class="dialog-footer">
                <el-row>
                    <el-col :span="12">
            <el-pagination background layout="prev, pager, next" :pagesize="modParam.pageSize"
                           :total="modParam.totalCount" :current-page.sync="modParam.currentPage"
                           @current-change="modChangePage">
            </el-pagination>
                        </el-col>
                    <el-col :span="12">
                 <el-button @click="closeMod()">
                         关闭
                 </el-button>
                        </el-col>
                    </el-row>
            </span>
        </el-dialog>
        <el-dialog
                title="二维码图片（时间可能较长，请等待……）"
                :visible.sync="qrcodeVisible"
                :fullscreen="true"
                :before-close="closeCode"
        >
            <h1 align="right">
                <el-button @click="printData('qrcodeDialog')" type="success">打印pdf</el-button>
            </h1>
            <div id="qrcodeDialog">
                <div id="qrcode" style="display: flex;flex-wrap: wrap">

                </div>
            </div>

        </el-dialog>
        <el-dialog
                style="display: none"
                title="设置巡检任务"
                :visible.sync="taskVisible"
                width="100%"
                :show-close="false"
        >
            <el-card>
                <div>
                    <el-button @click="addTask" type="primary" size="small">添加任务</el-button>
                </div>

                <el-row v-for="(item,i) in taskList" style="margin-top: 10px">
                    <el-col :span="6">
                        巡检人员
                        <!--<el-select v-model="item.userId" style="width:180px">-->
                        <!--<el-option-->
                        <!--v-for="item in userList"-->
                        <!--:key="item.Id"-->
                        <!--:label="item.Text"-->
                        <!--:value="item.Id" v-if="item.ParentId!=0">-->
                        <!--</el-option>-->
                        <!--</el-select>-->
                        <el-select v-model="item.group" multiple filterable placeholder="请选择，可多选"
                                   @change="select_status">
                            <el-option
                                    v-for="item in userList"
                                    :key="item.Id"
                                    :label="item.Text"
                                    :value="item.Id" v-if="item.ParentId!=0">
                            </el-option>
                        </el-select>
                    </el-col>
                    <el-col :span="4">
                        <span>巡检频次每</span>
                        <el-input type="number" v-model="item.cycle" min="1" max="100"
                                  style="width: 80px"></el-input>
                    </el-col>
                    <el-col :span="4">
                        <el-select v-model="item.cycleType" placeholder="周期类型" style="width: 120px">
                            <el-option label="分" value=0>分</el-option>
                            <el-option label="时" value=1>时</el-option>
                            <el-option label="天" value=2>天</el-option>
                            <el-option label="周" value=3>周</el-option>
                            <el-option label="月" value=4>月</el-option>
                            <el-option label="年" value=5>年</el-option>
                        </el-select>
                        一次
                    </el-col>
                    <el-col :span="6">
                        <span>巡检开始时间</span>
                        <el-date-picker
                                v-model="item.startTime"
                                type="datetime"
                                placeholder="选择日期时间"
                                format="yyyy-MM-dd HH:mm:ss"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                @change="datetimeChange"
                        >
                        </el-date-picker>
                    </el-col>
                    <el-col :span="4">
                        <el-button type="danger" @click="delTask(i)" size="small">删除此任务</el-button>
                        <el-button type="success" @click="saveTask(i)" size="small">保存任务</el-button>
                    </el-col>
                </el-row>

            </el-card>
            <br/>
            <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="taskCancel()"
                               style="text-align: center">关闭</el-button>
            </span>
        </el-dialog>
        <el-dialog
                style="display: none"
                title="风险任务内容详情"
                :visible.sync="taskDetailVisible"
                width="60%"
        >
            <h1 align="center">查看详情</h1>
            <h1 align="right">
                <el-button @click="exportDoc" type="success">导出word</el-button>
                <el-button @click="printData('risk_detail')" type="success">打印pdf</el-button>
            </h1>
            <div id="risk_detail">


                <table border="1" cellpadding="10" cellspacing="0" style="width: 100%">
                    <tr>
                        <td style="font-weight: bold">风险点分类</td>
                        <td>{{selectRisk.riskType == 0?'设备':(selectRisk.riskType == 1?'场所':'作业')}}</td>
                        <td style="font-weight: bold">风险点名称</td>
                        <td>{{selectRisk.riskName}}</td>
                        <td style="font-weight: bold">负责人</td>
                        <td>{{selectRisk.userName}}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold">风险点位置</td>
                        <td>{{selectRisk.location}}</td>
                        <td style="font-weight: bold">风险点等级</td>
                        <td colspan="3">
                            <template v-if="selectRisk.grade==1">
                                <img src="../../../imgs/onelevel.png">
                            </template>
                            <template v-if="selectRisk.grade==2">
                                <img src="../../../imgs/twolevel.png">
                            </template>
                            <template v-if="selectRisk.grade==3">
                                <img src="../../../imgs/threelevel.png">
                            </template>
                            <template v-if="selectRisk.grade==4">
                                <img src="../../../imgs/fourlevel.png">
                            </template>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold">可能性(L)</td>
                        <td>{{likelihoodJson[selectRisk.likelihood]}}</td>
                        <td style="font-weight: bold">频繁程度(E)</td>
                        <td>{{exposureJson[selectRisk.exposure]}}</td>
                        <td style="font-weight: bold">后果(C)</td>
                        <td>{{consequenceJson[selectRisk.consequence]}}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold">危险性(D)</td>
                        <td>
                            <template v-if="selectRisk.LecScore>=320">
                                极其危险({{selectRisk.LecScore}}分)
                            </template>
                            <template v-if="selectRisk.LecScore>=160&&selectRisk.LecScore<320">
                                高度危险({{selectRisk.LecScore}}分)
                            </template>
                            <template v-if="selectRisk.LecScore>=70&&selectRisk.LecScore<160">
                                显著危险({{selectRisk.LecScore}}分)
                            </template>
                            <template v-if="selectRisk.LecScore>0&&selectRisk.LecScore<70">
                                一般危险({{selectRisk.LecScore}}分)
                            </template>
                        </td>
                        <td style="font-weight: bold">风险点描述</td>
                        <td colspan="3">{{selectRisk.riskDesc}}</td>

                    </tr>
                </table>
                <el-table :data="riskItemArry" :stripe="true" :border="true" size="mini"
                          style="width: 100%;margin-top: 20px">
                    <el-table-column type="index" label="#" width="50" align="center"></el-table-column>
                    <el-table-column prop="title" label="风险内容" align="center"></el-table-column>
                    <el-table-column prop="reason" label="危害因素" align="center"></el-table-column>
                    <el-table-column prop="damageType" label="可能导致的事故" align="center"></el-table-column>
                    <el-table-column prop="scope" label="影响范围" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.scope==0">
                                <el-tag>本厂</el-tag>
                            </div>
                            <div v-if="scope.row.scope==1">
                                <el-tag>作业场所</el-tag>
                            </div>
                            <div v-if="scope.row.scope==2">
                                <el-tag>设备</el-tag>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="damage" label="潜在后果" align="center"></el-table-column>
                </el-table>
            </div>
            <br/>

            <span slot="footer" class="dialog-footer">
                    <el-button style="text-align: center" @click="taskDetailVisible=false">取消</el-button>
                    <el-button type="primary" @click="taskDetailVisible=false"
                               style="text-align: center">确定</el-button>
            </span>
        </el-dialog>
        <el-dialog
                style="display: none"
                title="编辑风险点"
                :visible.sync="editFormVisible"
                width="60%"
                :show-close="false"
        >
            <el-card>

                <el-form :model="editForm">
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="风险点分类" :label-width="formLabelWidth">
                                <el-select v-model="editForm.riskType">
                                    <el-option label="设备" value="0"></el-option>
                                    <el-option label="场所" value="1"></el-option>
                                    <el-option label="作业" value="2"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="风险点名称" :label-width="formLabelWidth">
                                <el-input v-model="editForm.riskName" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="风险点位置" :label-width="formLabelWidth">
                                <el-input v-model="editForm.location" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="负责人" :label-width="formLabelWidth">
                                <el-select v-model="editForm.manager" filterable>
                                    <el-option
                                            v-for="item in userList"
                                            :key="item.Id"
                                            :label="item.userName"
                                            :value="item.Id" v-if="item.ParentId!=0">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="检查类型" :label-width="formLabelWidth">
                                <el-select v-model="editForm.patrolType">
                                    <el-option value="0" label="经常性"></el-option>
                                    <el-option value="1" label="每日"></el-option>
                                    <el-option value="2" label="每周"></el-option>
                                    <el-option value="3" label="每月"></el-option>
                                    <el-option value="4" label="每季"></el-option>
                                    <el-option value="5" label="节假日"></el-option>
                                    <el-option value="6" label="综合检查"></el-option>
                                    <el-option value="7" label="专项检查"></el-option>
                                    <el-option value="8" label="年度检查"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="NFC编码" :label-width="formLabelWidth">
                                <el-input v-model="editForm.NFCCardNo" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="部门" :label-width="formLabelWidth">
                                <el-select v-model="editForm.departmentId" filterable @change="changeSelect">
                                    <el-option
                                            v-for="item in departList"
                                            :key="item.DepartmentID"
                                            :label="item.DepartmentName"
                                            :value="item.DepartmentID">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="区域" :label-width="formLabelWidth">
                                <el-select v-model="editForm.zoneId" filterable @change="changeSelect">
                                    <el-option
                                            v-for="item in zoneList"
                                            :key="item.zone_id"
                                            :label="item.zone_name"
                                            :value="item.zone_id">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <p style="color: #409EFF">LEC研判法</p>
                    <el-form-item label="发生事故的可能性(L)" prop="likelihood">
                        <el-radio-group v-model="editForm.likelihood" size="medium">
                            <el-radio border label=10>完全可以预料(10)</el-radio>
                            <el-radio border label=6>相当可能(6)</el-radio>
                            <el-radio border label=3>可能，但不经常(3)</el-radio>
                            <el-radio border label=1>可能性小，完全意外(1)</el-radio>
                            <el-radio border label=0.5>很不可能，可以设想(0.5)</el-radio>
                            <el-radio border label=0.2>极不可能(0.2)</el-radio>
                            <el-radio border label=0.1>实际不可能(0.1)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="暴露于危险环境的频繁程度(E)" prop="exposure">
                        <el-radio-group v-model="editForm.exposure" size="medium">
                            <el-radio border label=10>连续暴露(10)</el-radio>
                            <el-radio border label=6>每天工作时间内暴露(6)</el-radio>
                            <el-radio border label=3>每周一次，或偶然暴露(3)</el-radio>
                            <el-radio border label=2>每月一次暴露(2)</el-radio>
                            <el-radio border label=1>每年几次暴露(1)</el-radio>
                            <el-radio border label=0.5>非常罕见的暴露(0.5)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="事故可能造成的后果(C)" prop="consequence">
                        <el-radio-group v-model="editForm.consequence" size="medium">
                            <el-radio border label=100>10人以上死亡(100)</el-radio>
                            <el-radio border label=40>2~9人死亡(40)</el-radio>
                            <el-radio border label=15>1人死亡(15)</el-radio>
                            <el-radio border label=7>伤残(7)</el-radio>
                            <el-radio border label=3>重伤(3)</el-radio>
                            <el-radio border label=1>轻伤(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>


                    <h2>风险研判规则</h2>
                    <table align="center" border="1" cellspacing="0" cellpadding="10">
                        <tr>
                            <td>D值</td>
                            <td>危险程度</td>
                            <td>危险等级</td>
                        </tr>
                        <tr>
                            <td>>=320</td>
                            <td>重大风险</td>
                            <td><img src="../../../imgs/onelevel.png"></td>
                        </tr>
                        <tr>
                            <td>160~320</td>
                            <td>较大风险</td>
                            <td><img src="../../../imgs/twolevel.png"></td>
                        </tr>
                        <tr>
                            <td>70~160</td>
                            <td>一般风险</td>
                            <td><img src="../../../imgs/threelevel.png"></td>
                        </tr>
                        <tr>
                            <td>0~70</td>
                            <td>低风险</td>
                            <td><img src="../../../imgs/fourlevel.png"></td>
                        </tr>
                    </table>
                    <div style="margin-top: 10px">
                        危险性(D=L*E*C):
                        <el-input :value="editForm.consequence*editForm.exposure*editForm.likelihood" autocomplete="off"
                                  style="width: 130px" readonly></el-input>
                    </div>


                    <p style="color: #409EFF">LS研判法</p>
                    <el-form-item label="事故发生的可能性(L)" prop="patrolType">
                        <el-radio-group v-model="editForm.possible" size="medium">
                            <el-radio border label=5>极有可能发生(5)</el-radio>
                            <el-radio border label=4>很可能发生(4)</el-radio>
                            <el-radio border label=3>可能发生(3)</el-radio>
                            <el-radio border label=2>较不可能发生(2)</el-radio>
                            <el-radio border label=1>基本不可能发生(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="事故后果严重性(S)" prop="patrolType">
                        <el-radio-group v-model="editForm.seriouse" size="medium">
                            <el-radio border label=5>影响特别重大(5)</el-radio>
                            <el-radio border label=4>影响重大(4)</el-radio>
                            <el-radio border label=3>影响较大(3)</el-radio>
                            <el-radio border label=2>影响一般(2)</el-radio>
                            <el-radio border label=1>影响很小(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>


                    <h2>风险研判矩阵</h2>
                    <table align="center" border="1" cellpadding="10" cellspacing="0">
                        <tr>
                            <td class="first"><span class="title1">严重性(S)</span><br><span class="title2">可能性(L)</span>
                            </td>
                            <td>影响特别重大(5)</td>
                            <td>影响重大(4)</td>
                            <td>影响较大(3)</td>
                            <td>影响一般(2)</td>
                            <td>影响很小(1)</td>
                        </tr>
                        <tr>
                            <td>Ⅰ：极有可能发生</td>
                            <td style="background: red;">25</td>
                            <td style="background: red;">20</td>
                            <td style="background: orange;">15</td>
                            <td style="background: yellow;">10</td>
                            <td style="background: blue;">5</td>
                        </tr>
                        <tr>
                            <td>Ⅱ：很有可能发生</td>
                            <td style="background: red;">20</td>
                            <td style="background: orange;">16</td>
                            <td style="background: yellow;">12</td>
                            <td style="background: yellow;">8</td>
                            <td style="background: blue;">4</td>
                        </tr>
                        <tr>
                            <td>Ⅲ：可能发生</td>
                            <td style="background: orange;">15</td>
                            <td style="background: yellow;">12</td>
                            <td style="background: yellow;">9</td>
                            <td style="background: blue;">6</td>
                            <td style="background: blue;">3</td>
                        </tr>
                        <tr>
                            <td>Ⅳ：较不可能发生</td>
                            <td style="background: yellow;">10</td>
                            <td style="background: yellow;">8</td>
                            <td style="background: blue;">6</td>
                            <td style="background: blue;">4</td>
                            <td style="background: blue;">2</td>
                        </tr>
                        <tr>
                            <td>基本不可能发生(1)</td>
                            <td style="background: blue;">5</td>
                            <td style="background: blue;">4</td>
                            <td style="background: blue;">3</td>
                            <td style="background: blue;">2</td>
                            <td style="background: blue;">1</td>
                        </tr>
                    </table>
                    <div style="margin-top: 10px">
                        风险值(R=L*S):
                        <el-input :value="editForm.possible*editForm.seriouse" autocomplete="off"
                                  style="width: 130px"></el-input>
                    </div>
                    <el-button type="success" @click="addRiskContent()">添加一行</el-button>
                    <table width="100%" cellspacing="0" cellpadding="10" border="1">
                        <tr>
                            <td>风险内容</td>
                            <td>危害因素</td>
                            <td>可能导致的事故</td>
                            <td>影响范围</td>
                            <td>潜在后果</td>
                            <td>风险参数</td>
                            <td>管控措施</td>
                            <td>操作</td>
                        </tr>
                        <tr v-for="(item,i) in riskContent">
                            <td>
                                <el-input v-model="item.title"/>
                            </td>
                            <td>
                                <el-input v-model="item.reason"/>
                            </td>
                            <td>
                                <el-input v-model="item.damageType"/>
                            </td>
                            <td>
                                <el-select v-model="item.scope">
                                    <el-option value="0" label="本厂"></el-option>
                                    <el-option value="1" label="作业场所"></el-option>
                                    <el-option value="2" label="设备"></el-option>
                                </el-select>
                            </td>
                            <td>
                                <el-input v-model="item.damage"/>
                            </td>
                            <td>
                                <el-input v-model="item.basis"/>
                            </td>
                            <td>
                                <el-input v-model="item.controllMethod"/>
                            </td>
                            <td style="display: flex;">
                                <el-button @click="RiskItemAdd(i)" type="success" size="mini">保存</el-button>
                                <el-button @click="delRiskContent(i)" type="warning" size="mini">删除</el-button>
                            </td>
                        </tr>
                    </table>
                    <el-form-item label="风险点描述">
                        <el-input type="textarea" v-model="editForm.riskDesc" placeholder="风险点描述"></el-input>
                    </el-form-item>

                    <el-form-item label="可能造成后果">
                        <el-input type="textarea" v-model="editForm.possibleResult" placeholder="可能造成后果"></el-input>
                    </el-form-item>

                    <el-form-item label="详细位置">
                        <el-input type="textarea" v-model="editForm.address" placeholder="详细位置"></el-input>
                    </el-form-item>

                    <el-form-item label="诱发事故类型">
                        <el-input type="textarea" v-model="editForm.damageType" placeholder="诱发事故类型"></el-input>
                    </el-form-item>

                    <el-form-item label="损失预测">
                        <el-input type="textarea" v-model="editForm.damageForecast" placeholder="损失预测"></el-input>
                    </el-form-item>

                    <el-form-item label="管控措施">
                        <el-input type="textarea" v-model="editForm.controllMethod" placeholder="管控措施"></el-input>
                    </el-form-item>

                    <el-form-item label="存在隐患情况">
                        <el-input type="textarea" v-model="editForm.dangerDesc" placeholder="存在隐患情况"></el-input>
                    </el-form-item>

                    <el-form-item label="应急处置措施">
                        <el-input type="textarea" v-model="editForm.processMethod" placeholder="应急处置措施"></el-input>
                    </el-form-item>

                    <el-form-item label="技术保障措施">
                        <el-input type="textarea" v-model="editForm.insureMethod" placeholder="技术保障措施"></el-input>
                    </el-form-item>
                </el-form>
            </el-card>
            <br/>

            <span slot="footer" class="dialog-footer">
                    <el-button style="text-align: center" @click="riskCancel()">取消</el-button>
                    <el-button type="primary" @click="editRisk()"
                               style="text-align: center">确定</el-button>
            </span>
        </el-dialog>
        <el-dialog
                style="display: none"
                title="新增风险点"
                :visible.sync="addFormVisible"
                width="75%"
                :show-close="false"
        >
            <el-card>
                <h1 align="right">
                    <el-button @click="printData('print')" type="success">打印pdf</el-button>
                </h1>
                <el-form :model="form" id="print">
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="风险点分类" :label-width="formLabelWidth">
                                <el-select v-model="form.riskType">
                                    <el-option label="设备" value="0"></el-option>
                                    <el-option label="场所" value="1"></el-option>
                                    <el-option label="作业" value="2"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="风险点名称" :label-width="formLabelWidth">
                                <el-input v-model="form.riskName" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="风险点位置" :label-width="formLabelWidth">
                                <el-input v-model="form.location" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="负责人" :label-width="formLabelWidth">
                                <el-select v-model="form.manager" filterable>
                                    <el-option
                                            v-for="item in userList"
                                            :key="item.Id"
                                            :label="item.userName"
                                            :value="item.Id" v-if="item.ParentId!=0">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="检查类型" :label-width="formLabelWidth">
                                <el-select v-model="form.patrolType">
                                    <el-option value="0" label="经常性"></el-option>
                                    <el-option value="1" label="每日"></el-option>
                                    <el-option value="2" label="每周"></el-option>
                                    <el-option value="3" label="每月"></el-option>
                                    <el-option value="4" label="每季"></el-option>
                                    <el-option value="5" label="节假日"></el-option>
                                    <el-option value="6" label="综合检查"></el-option>
                                    <el-option value="7" label="专项检查"></el-option>
                                    <el-option value="8" label="年度检查"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="NFC编码" :label-width="formLabelWidth">
                                <el-input v-model="form.NFCCardNo" autocomplete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="部门" :label-width="formLabelWidth">
                                <el-select v-model="form.departmentId" filterable @change="select_status()">
                                    <el-option
                                            v-for="item in departList"
                                            :key="item.DepartmentID"
                                            :label="item.DepartmentName"
                                            :value="item.DepartmentID">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="区域" :label-width="formLabelWidth">
                                <el-select v-model="form.zoneId" filterable>
                                    <el-option
                                            v-for="item in zoneList"
                                            :key="item.zone_id"
                                            :label="item.zone_name"
                                            :value="item.zone_id">
                                    </el-option>
                                </el-select>
                                <el-button @click="openZone()">+</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <p style="color: #409EFF">LEC研判法
                        <el-popover
                                placement="right"
                                width="600"
                                trigger="click"
                                popper-class="popClass">
                            <el-table :data="LECdata.LECL">
                                <el-table-column width="250" property="systitle" label="标准"></el-table-column>
                                <el-table-column width="250" property="comtitle" label="本企的标准"></el-table-column>
                            </el-table>
                            <el-table :data="LECdata.LECE">
                                <el-table-column width="250" property="systitle" label="标准"></el-table-column>
                                <el-table-column width="250" property="comtitle" label="本企的标准"></el-table-column>
                            </el-table>
                            <el-table :data="LECdata.LECC">
                                <el-table-column width="250" property="systitle" label="标准"></el-table-column>
                                <el-table-column width="250" property="comtitle" label="本企的标准"></el-table-column>
                            </el-table>
                            <el-button icon='el-icon-question' size="mini" type="primary" plain slot="reference">标准
                            </el-button>
                        </el-popover>
                    </p>
                    <el-form-item label="发生事故的可能性(L)" prop="likelihood">
                        <el-radio-group v-model="form.likelihood" size="medium">
                            <el-radio border label=10>完全可以预料(10)</el-radio>
                            <el-radio border label=6>相当可能(6)</el-radio>
                            <el-radio border label=3>可能，但不经常(3)</el-radio>
                            <el-radio border label=1>可能性小，完全意外(1)</el-radio>
                            <el-radio border label=0.5>很不可能，可以设想(0.5)</el-radio>
                            <el-radio border label=0.2>极不可能(0.2)</el-radio>
                            <el-radio border label=0.1>实际不可能(0.1)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="暴露于危险环境的频繁程度(E)" prop="exposure">
                        <el-radio-group v-model="form.exposure" size="medium">
                            <el-radio border label=10>连续暴露(10)</el-radio>
                            <el-radio border label=6>每天工作时间内暴露(6)</el-radio>
                            <el-radio border label=3>每周一次，或偶然暴露(3)</el-radio>
                            <el-radio border label=2>每月一次暴露(2)</el-radio>
                            <el-radio border label=1>每年几次暴露(1)</el-radio>
                            <el-radio border label=0.5>非常罕见的暴露(0.5)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="事故可能造成的后果(C)" prop="consequence">
                        <el-radio-group v-model="form.consequence" size="medium">
                            <el-radio border label=100>10人以上死亡(100)</el-radio>
                            <el-radio border label=40>2~9人死亡(40)</el-radio>
                            <el-radio border label=15>1人死亡(15)</el-radio>
                            <el-radio border label=7>伤残(7)</el-radio>
                            <el-radio border label=3>重伤(3)</el-radio>
                            <el-radio border label=1>轻伤(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <h2>风险研判规则</h2>
                    <table align="center" border="1" cellspacing="0" cellpadding="10">
                        <tr>
                            <td>D值</td>
                            <td>危险程度</td>
                            <td>危险等级</td>
                        </tr>
                        <tr>
                            <td>>=320</td>
                            <td>重大风险</td>
                            <td><img src="../../../imgs/onelevel.png"></td>
                        </tr>
                        <tr>
                            <td>160~320</td>
                            <td>较大风险</td>
                            <td><img src="../../../imgs/twolevel.png"></td>
                        </tr>
                        <tr>
                            <td>70~160</td>
                            <td>一般风险</td>
                            <td><img src="../../../imgs/threelevel.png"></td>
                        </tr>
                        <tr>
                            <td>0~70</td>
                            <td>低风险</td>
                            <td><img src="../../../imgs/fourlevel.png"></td>
                        </tr>
                    </table>
                    <div style="margin-top: 10px">
                        危险性(D=L*E*C):
                        <el-input :value="form.consequence*form.exposure*form.likelihood" autocomplete="off"
                                  style="width: 130px" readonly></el-input>
                    </div>


                    <p style="color: #409EFF">LS研判法
                        <el-popover
                                placement="right"
                                width="600"
                                trigger="click"
                                popper-class="popClass">
                            <el-table :data="LSdata.LSL">
                                <el-table-column width="250" property="systitle" label="标准"></el-table-column>
                                <el-table-column width="250" property="comtitle" label="本企的标准"></el-table-column>
                            </el-table>
                            <el-table :data="LSdata.LSS">
                                <el-table-column width="250" property="systitle" label="标准"></el-table-column>
                                <el-table-column width="250" property="comtitle" label="本企的标准"></el-table-column>
                            </el-table>
                            <el-button icon='el-icon-question' size="mini" type="primary" plain slot="reference">标准
                            </el-button>
                        </el-popover>
                    </p>
                    <el-form-item label="事故发生的可能性(L)" prop="patrolType">
                        <el-radio-group v-model="form.possible" size="medium">
                            <el-radio border label=5>极有可能发生(5)</el-radio>
                            <el-radio border label=4>很可能发生(4)</el-radio>
                            <el-radio border label=3>可能发生(3)</el-radio>
                            <el-radio border label=2>较不可能发生(2)</el-radio>
                            <el-radio border label=1>基本不可能发生(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="事故后果严重性(S)" prop="patrolType">
                        <el-radio-group v-model="form.seriouse" size="medium">
                            <el-radio border label=5>影响特别重大(5)</el-radio>
                            <el-radio border label=4>影响重大(4)</el-radio>
                            <el-radio border label=3>影响较大(3)</el-radio>
                            <el-radio border label=2>影响一般(2)</el-radio>
                            <el-radio border label=1>影响很小(1)</el-radio>
                        </el-radio-group>
                    </el-form-item>


                    <h2>风险研判矩阵</h2>
                    <table align="center" border="1" cellpadding="10" cellspacing="0">
                        <tr>
                            <td class="first"><span class="title1">严重性(S)</span><br><span class="title2">可能性(L)</span>
                            </td>
                            <td>影响特别重大(5)</td>
                            <td>影响重大(4)</td>
                            <td>影响较大(3)</td>
                            <td>影响一般(2)</td>
                            <td>影响很小(1)</td>
                        </tr>
                        <tr>
                            <td>Ⅰ：极有可能发生</td>
                            <td style="background: red;">25</td>
                            <td style="background: red;">20</td>
                            <td style="background: orange;">15</td>
                            <td style="background: yellow;">10</td>
                            <td style="background: blue;">5</td>
                        </tr>
                        <tr>
                            <td>Ⅱ：很有可能发生</td>
                            <td style="background: red;">20</td>
                            <td style="background: orange;">16</td>
                            <td style="background: yellow;">12</td>
                            <td style="background: yellow;">8</td>
                            <td style="background: blue;">4</td>
                        </tr>
                        <tr>
                            <td>Ⅲ：可能发生</td>
                            <td style="background: orange;">15</td>
                            <td style="background: yellow;">12</td>
                            <td style="background: yellow;">9</td>
                            <td style="background: blue;">6</td>
                            <td style="background: blue;">3</td>
                        </tr>
                        <tr>
                            <td>Ⅳ：较不可能发生</td>
                            <td style="background: yellow;">10</td>
                            <td style="background: yellow;">8</td>
                            <td style="background: blue;">6</td>
                            <td style="background: blue;">4</td>
                            <td style="background: blue;">2</td>
                        </tr>
                        <tr>
                            <td>基本不可能发生(1)</td>
                            <td style="background: blue;">5</td>
                            <td style="background: blue;">4</td>
                            <td style="background: blue;">3</td>
                            <td style="background: blue;">2</td>
                            <td style="background: blue;">1</td>
                        </tr>
                    </table>
                    <div style="margin-top: 10px">
                        风险值(R=L*S):
                        <el-input :value="form.possible*form.seriouse" autocomplete="off"
                                  style="width: 130px"></el-input>
                    </div>


                    <!--<p style="color: #409EFF">MES研判法-->
                    <!--&lt;!&ndash;<el-popover&ndash;&gt;-->
                    <!--&lt;!&ndash;placement="right"&ndash;&gt;-->
                    <!--&lt;!&ndash;width="500"&ndash;&gt;-->
                    <!--&lt;!&ndash;trigger="click">&ndash;&gt;-->
                    <!--&lt;!&ndash;<el-table :data="gridData">&ndash;&gt;-->
                    <!--&lt;!&ndash;<el-table-column width="100" property="date" label="日期"></el-table-column>&ndash;&gt;-->
                    <!--&lt;!&ndash;<el-table-column width="100" property="name" label="姓名"></el-table-column>&ndash;&gt;-->
                    <!--&lt;!&ndash;<el-table-column width="300" property="address" label="地址"></el-table-column>&ndash;&gt;-->
                    <!--&lt;!&ndash;</el-table>&ndash;&gt;-->
                    <!--&lt;!&ndash;<el-button icon='el-icon-question' size="mini" type="primary" plain slot="reference">标准</el-button>&ndash;&gt;-->
                    <!--&lt;!&ndash;</el-popover>&ndash;&gt;-->
                    <!--</p>-->
                    <!--<el-form-item label="控制措施的状态（M）" prop="patrolType">-->
                    <!--<el-radio-group v-model="form.possible" size="medium">-->
                    <!--<el-radio border label=5>无控制措施(5)</el-radio>-->
                    <!--<el-radio border label=3>有减轻后果的应急措施，如警报系统、个体防护用品(3)</el-radio>-->
                    <!--<el-radio border label=1>有预防措施，如机器防护装置等，但须保证有效(1)</el-radio>-->
                    <!--</el-radio-group>-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="人体暴露于危险状态的频繁程度或危险状态出现的频次（E）" prop="patrolType">-->
                    <!--<el-radio-group v-model="form.possible" size="medium">-->
                    <!--<el-radio border label=10>连续暴露(10)</el-radio>-->
                    <!--<el-radio border label=6>每天工作时间内暴露(6)</el-radio>-->
                    <!--<el-radio border label=3>每周一次，或偶然暴露(3)</el-radio>-->
                    <!--<el-radio border label=1>每年几次暴露(1)</el-radio>-->
                    <!--<el-radio border label=0.5>更少的暴露(0.5)</el-radio>-->
                    <!--</el-radio-group>-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="事故的可能后果严重性（S）" prop="patrolType">-->
                    <!--<el-radio-group v-model="form.seriouse" size="medium">-->
                    <!--<el-radio border label=10>有多人死亡(10) </el-radio>-->
                    <!--<el-radio border label=8>有一人死亡或多人永久失能(8) </el-radio>-->
                    <!--<el-radio border label=4>永久失能（一人）(4) </el-radio>-->
                    <!--<el-radio border label=2>需医院治疗，缺工(2) </el-radio>-->
                    <!--<el-radio border label=1>轻微，仅需急救(1) </el-radio>-->
                    <!--</el-radio-group>-->
                    <!--</el-form-item>-->


                    <!--<h2>风险研判规则</h2>-->
                    <!--<table align="center" border="1"cellspacing="0" cellpadding="10" >-->
                    <!--<tr>-->
                    <!--<td>D值</td>-->
                    <!--<td>危险程度</td>-->
                    <!--<td>危险等级</td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                    <!--<td>>=180</td>-->
                    <!--<td>极其危险</td>-->
                    <!--<td><img src="../../../imgs/onelevel.png"></td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                    <!--<td>90~150</td>-->
                    <!--<td>高度危险</td>-->
                    <!--<td><img src="../../../imgs/twolevel.png"></td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                    <!--<td>50~80</td>-->
                    <!--<td>显著危险</td>-->
                    <!--<td><img src="../../../imgs/threelevel.png"></td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                    <!--<td>0~48</td>-->
                    <!--<td>一般危险</td>-->
                    <!--<td><img src="../../../imgs/fourlevel.png"></td>-->
                    <!--</tr>-->
                    <!--</table>-->
                    <!--<div style="margin-top: 10px">-->
                    <!--风险值(R=L*S):<el-input :value="form.possible*form.seriouse" autocomplete="off" style="width: 130px"></el-input>-->
                    <!--</div>-->


                    <el-button type="success" @click="addRiskContent()">添加一行</el-button>
                    <table width="100%" cellspacing="0" cellpadding="10" border="1">
                        <tr>
                            <td>风险内容</td>
                            <td>危害因素</td>
                            <td>可能导致的事故</td>
                            <td>影响范围</td>
                            <td>潜在后果</td>
                            <td>风险参数</td>
                            <td>管控措施</td>
                        </tr>
                        <tr v-for="(item,i) in riskContent">
                            <td>
                                <el-input v-model="item.title"/>
                            </td>
                            <td>
                                <el-input v-model="item.reason"/>
                            </td>
                            <td>
                                <el-input v-model="item.damageType"/>
                            </td>
                            <td>
                                <el-select v-model="item.scope">
                                    <el-option value="0" label="本厂"></el-option>
                                    <el-option value="1" label="作业场所"></el-option>
                                    <el-option value="2" label="设备"></el-option>
                                </el-select>
                            </td>
                            <td>
                                <el-input v-model="item.damage"/>
                            </td>
                            <td>
                                <el-input v-model="item.basis"/>
                            </td>
                            <td>
                                <el-input v-model="item.controllMethod"/>
                            </td>
                        </tr>
                    </table>
                    <el-form-item label="风险点描述">
                        <el-input type="textarea" v-model="form.riskDesc" placeholder="风险点描述"></el-input>
                    </el-form-item>

                    <el-form-item label="可能造成后果">
                        <el-input type="textarea" v-model="form.possibleResult" placeholder="可能造成后果"></el-input>
                    </el-form-item>

                    <el-form-item label="详细位置">
                        <el-input type="textarea" v-model="form.address" placeholder="详细位置"></el-input>
                    </el-form-item>

                    <el-form-item label="诱发事故类型">
                        <el-input type="textarea" v-model="form.damageType" placeholder="诱发事故类型"></el-input>
                    </el-form-item>

                    <el-form-item label="损失预测">
                        <el-input type="textarea" v-model="form.damageForecast" placeholder="损失预测"></el-input>
                    </el-form-item>

                    <el-form-item label="管控措施">
                        <el-input type="textarea" v-model="form.controllMethod" placeholder="管控措施"></el-input>
                    </el-form-item>

                    <el-form-item label="存在隐患情况">
                        <el-input type="textarea" v-model="form.dangerDesc" placeholder="存在隐患情况"></el-input>
                    </el-form-item>

                    <el-form-item label="应急处置措施">
                        <el-input type="textarea" v-model="form.processMethod" placeholder="应急处置措施"></el-input>
                    </el-form-item>

                    <el-form-item label="技术保障措施">
                        <el-input type="textarea" v-model="form.insureMethod" placeholder="技术保障措施"></el-input>
                    </el-form-item>
                </el-form>
            </el-card>
            <br/>

            <span slot="footer" class="dialog-footer">
                    <el-button style="text-align: center" @click="riskCancel()">取消</el-button>
                    <el-button type="primary" @click="addRisk()"
                               style="text-align: center">确定</el-button>
            </span>
        </el-dialog>

        <el-dialog
                title="增加区域"
                :visible.sync="zoneFormVisible"
                width="100%"
                :show-close="false"
        >
            <iframe src="../system-manage/zone-manage.html" width="95%" height="500"></iframe>
            <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="zoneClose()" style="text-align: center">关闭</el-button>
            </span>
        </el-dialog>
        <iframe id="printf" style="display: none"></iframe>

        <el-dialog
                title="上传LEC风险"
                :visible.sync="LECFormVisible"
                width="500px"
                :show-close="false"
        >
            <!--iot.hzcando.com-->
            <el-upload
                    class="upload-demo"
                    drag
                    action="http://iot.hzcando.com:10004/api/idm/v1/Risk/RiskLECImport"
                    :on-success="uploadSuccess"
                    :on-error="uploadError"
                    :headers="headers"
                    name="excelfile"
                    :data="addForm"
                    :limit="1"
                    :auto-upload="false"
                    ref="LEC">
                <i class="el-icon-upload"></i>
                <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                <div class="el-upload__tip" slot="tip">请上传excel文件</div>
            </el-upload>
            <span slot="footer" class="dialog-footer">
                <el-button type="info" @click="LECFormVisible=false" style="text-align: center">关闭</el-button>
                <el-button type="primary" @click="UploadFile('LEC')" style="text-align: center">确定</el-button>
            </span>
        </el-dialog>
        <el-dialog
                title="上传LS风险"
                :visible.sync="LSFormVisible"
                width="500px"
                :show-close="false"
        >
            <!--iot.hzcando.com-->
            <el-upload
                    class="upload-demo"
                    drag
                    action="http://iot.hzcando.com:10004/api/idm/v1/Risk/RiskLSImport"
                    :on-success="uploadSuccess"
                    :on-error="uploadError"
                    :headers="headers"
                    name="excelfile"
                    :data="addForm"
                    :limit="1"
                    :auto-upload="false"
                    ref="LS">
                <i class="el-icon-upload"></i>
                <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                <div class="el-upload__tip" slot="tip">请上传excel文件</div>
            </el-upload>
            <span slot="footer" class="dialog-footer">
                <el-button type="info" @click="LSFormVisible=false" style="text-align: center">关闭</el-button>
                <el-button type="primary" @click="UploadFile('LS')" style="text-align: center">确定</el-button>
            </span>
        </el-dialog>
    </el-row>
</div>
<script>
    var vuePage = new Vue({
        el: '#page-monitor',
        data: {
            LSFormVisible: false,
            LECFormVisible: false,
            headers: {
                uid: '',
                token: '',
            },
            addForm: {
                projectNo: SiteConfig.account.projectNo
            },
            modForm: {
                cid: '',
                riskName: '',
            },
            tableData: [],
            addFormVisible: false,
            editFormVisible: false,
            modVisible: false,
            pageSize: 10,
            currentPage: 1,
            totalCount: 0,
            modParam: {
                pageSize: 10,
                currentPage: 1,
                totalCount: 0,
            },
            form: {
                projectNo: '',
                riskName: '',
                riskType: '',
                location: '',
                manager: '',
                patrolType: '',
                NFCCardNo: '',
                likelihood: '',
                exposure: '',
                consequence: '',
                LecScore: '',
                dangerGrade: '',
                possible: '',
                seriouse: '',
                lsScore: '',
                riskGrade: '',
                grade: '',
                riskStatus: 0,
                riskDesc: '',
            },
            editForm: {
                projectNo: '',
                riskName: '',
                riskType: '',
                location: '',
                manager: '',
                patrolType: '',
                NFCCardNo: '',
                likelihood: '',
                exposure: '',
                consequence: '',
                LecScore: '',
                dangerGrade: '',
                possible: '',
                seriouse: '',
                lsScore: '',
                riskGrade: '',
                grade: '',
                riskStatus: 0,
                riskDesc: '',
            },
            searchForm: {},
            likelihoodJson: {
                10: '完全可以预料(10)',
                6: '相当可能(6)',
                3: '可能，但不经常(3)',
                1: '可能性小，完全意外(1)',
                0.5: '很不可能，可以设想(0.5)',
                0.2: '极不可能(0.2)',
                0.1: '实际不可能(0.1)',
            },
            exposureJson: {
                10: '连续暴露(10)',
                6: '每天工作时间内暴露(6)',
                3: '每周一次，或偶然暴露(3)',
                2: '每月一次暴露(2)',
                1: '每年几次暴露(1)',
                0.5: '非常罕见的暴露(0.5)',
            },
            consequenceJson: {
                100: '10人以上死亡(100)',
                40: '2~9人死亡(40)',
                15: '1人死亡(15)',
                7: '伤残(7)',
                3: '重伤(3)',
                1: '轻伤(1)',
            },
            possibleJson: {
                5: '极有可能发生(5)',
                4: '很可能发生(4)',
                3: '可能发生(3)',
                2: '较不可能发生(2)',
                1: '基本不可能发生(1)',
            },
            seriouseJson: {
                5: '影响特别重大(5)',
                4: '影响重大(4)',
                3: '影响较大(3)',
                2: '影响一般(2)',
                1: '影响很小(1)',
            },
            formLabelWidth: '120px',
            taskList: [],
            taskVisible: false,
            taskDetailVisible: false,
            riskContent: [],
            riskItemArry: [],
            selectRisk: '',
            userList: [],
            departList: [],
            zoneList: [],
            LECdata: {},
            LSdata: {},
            qrcodeVisible: false,
            flag: false,
            modData: [],
            businessType: [],
            zoneFormVisible: false
        },
        methods: {
            /**
             *日期时间改变
             * **/
            datetimeChange() {
                this.$set(this.taskList);
            },
            select_status() {
                this.$forceUpdate();
            },
            //          上传成功
            uploadSuccess(res, file, fileList) {
                this.$message.success('上传成功')
                if (this.$refs.LEC)
                    this.$refs.LEC.clearFiles()
                if (this.$refs.LS)
                    this.$refs.LS.clearFiles()
                this.LECFormVisible = false;
                this.LSFormVisible = false;
                this.getRisk({});
                window.history.go(0);

            },
            changeSelect() {
                this.$forceUpdate();
            },
//         上传失败
            uploadError(err, file) {
                this.$message.error('上传失败' + err.errMsg)
            },
            UploadFile: function (name) {
                this.$refs[name].submit();
            },
            LECfileUp: function () {
                this.LECFormVisible = true;
            },
            LSfileUp: function () {
                this.LSFormVisible = true;
            },
            LECdowload: function () {
                window.location = SiteConfig.webApiset + '/../LEC.xlsx';
            },
            LSdowload: function () {
                window.location = SiteConfig.webApiset + '/../LS.xlsx';
            },
            zoneClose: function () {
                this.zoneFormVisible = false;
                this.getZone();
            },
            openZone: function () {
                this.zoneFormVisible = true;
            },
            search: function () {
                this.currentPage = 1;
                this.getRisk(this.searchForm);
            },
            printData(str) {
                var printhtml = document.getElementById(str).innerHTML;
                // 生成并打印ifrme
                printhtml += '    <link rel="stylesheet" href="../../../assets/theme-chalk/index.css">\n' +
                    '    <link rel="stylesheet" href="../../../style.css">'
                var f = document.getElementById('printf');
                f.contentDocument.write(printhtml);
                f.contentDocument.close();
                f.contentWindow.print();
            },
            addClick: function () {
                this.addFormVisible = true;
            },
            onChangePage: function (page) {
                this.currentPage = page;
                this.getRisk(this.searchForm);
            },
            closeCode(done){
                $('#qrcode').empty();
                done();
            },
            showImg: function (row) {
                this.qrcodeVisible = true;
                setTimeout(() => {

                    let str = '<div id="qrcodeImg"  style="margin: 20px;width: 260px;height: 260px"></div>';
                    $('#qrcode').append(str);
                    var  qrcode =  $('#qrcodeImg').qrcode('https://iot.hzcando.com/images?id=1&riskNo='+row.riskNo);
                    var canvas = qrcode.find('canvas').get(0);
                    // var context = canvas.getContext('2d');
                    // context.font = "20px bolder italic";
                    // context.fillStyle = "#2eff5e";
                    // context.textAlign = "center";
                    // context.textBaseline = "middle";
                    // context.fillText(row.riskName, 120, 220);
                    let src = canvas.toDataURL("image/png");
                    $('#qrcodeImg').css("background-image", "url("+src+")");

                }, 0)
            },
            OnekeyCode(){
                let param = this.searchForm;
                param.projectNo = SiteConfig.account.projectNo;
                param.pagesize = this.totalCount;
                HttpUtil.get('Risk/List', param).success((res) => {
                    this.qrcodeVisible = true;
                    setTimeout(() => {
                        for (let i = 0 ; i<this.totalCount;i++){
                            let str = '<div><div id="qrcodeImg'+i+'"  class="bgFull" style="margin:0 20px;width: 260px;height: 260px"></div><p class="risk_name">'+res.data[i].riskName+'</p></div>';
                            $('#qrcode').append(str);
                        }
                        for (let i = 0 ; i<this.totalCount;i++){
                            var  qrcode =  $('#qrcodeImg'+i).qrcode('https://iot.hzcando.com/images?id=1&riskNo='+res.data[i].riskNo);
                            var canvas = qrcode.find('canvas').get(0);
                            // var context = canvas.getContext('2d');
                            // context.font = "20px bolder italic";
                            // context.fillStyle = "#2eff5e";
                            // context.textAlign = "center";
                            // context.textBaseline = "middle";
                            // context.fillText(res.data[i].riskName, 120, 220);
                            let src = canvas.toDataURL("image/png");
                            $('#qrcodeImg'+i).css("background-image", "url("+src+")")
                            $('#qrcodeImg'+i).empty();
                        }

                    }, 0)
                });
            },
            statusBtn: function (row, status) {
                row.useFlag = status;
                HttpUtil.post('Risk/Update', row).success((res) => {
                    this.getRisk({});
                })
            },
            OnekeyBtn: function (useFlag) {
                var p = {
                    useFlag: useFlag,
                    projectNo: SiteConfig.account.projectNo
                };
                HttpUtil.get('Risk/Onekey', p).success((res) => {
                    if (res.state == 0) {
                        this.$message.success('操作成功');
                        this.getRisk({});
                    }
                    else {
                        this.$message.error(res.errMsg);
                    }
                })
            },
            taskClick: function (row) {
                this.taskVisible = true;
                this.selectRisk = row;
                HttpUtil.get('Risk/taskList', {
                    projectNo: SiteConfig.account.projectNo,
                    riskNo: row.riskNo,
                    pagesize: 100
                }).success((res) => {
                    for (let ind in res.data) {

                        res.data[ind].projectNo = SiteConfig.account.projectNo;
                        res.data[ind].riskNo = row.riskNo;
                        res.data[ind].Id = res.data[ind].task.Id;
                        res.data[ind].Id = res.data[ind].task.Id;
                        res.data[ind].cycleType = res.data[ind].task.cycleType + '';
                        res.data[ind].cycle = res.data[ind].task.cycle + '';
                        res.data[ind].startTime = res.data[ind].task.startTime;
                        res.data[ind].GroupId = res.data[ind].task.GroupId;
                        let obj = [];
                        for (var i = 0; i < res.data[ind].group.length; i++) {
                            obj.push(res.data[ind].group[i].Id);
                        }
                        res.data[ind].group = obj;
                    }
                    this.taskList = res.data;

                    // for (var i = 0; i < premapsDatas.length; i++) {
                    //     vuePage.sel_map.push(premapsDatas[i].MapId);
                    // }
                })
            },
            RiskItemAdd: function (index) {
                this.riskContent[index].riskNo = this.selectRisk.riskNo;
                if (this.riskContent[index].Id) {
                    HttpUtil.get('Riskitem/Update', this.riskContent[index]).success((res) => {
                        this.$message.success('保存成功')
                    })
                } else {
                    HttpUtil.get('Riskitem/Add', this.riskContent[index]).success((res) => {
                        this.$message.success('保存成功');
                    })
                }
            },
            handleClick: function (row) {
                this.editForm = Object.assign(this.editForm, row);
                // this.editForm = row;
                this.editForm.likelihood = this.editForm.likelihood + '';
                this.editForm.exposure = this.editForm.exposure + '';
                this.editForm.consequence = this.editForm.consequence + '';
                this.editForm.possible = this.editForm.possible + '';
                this.editForm.seriouse = this.editForm.seriouse + '';
                this.editForm.riskType = this.editForm.riskType + '';
                this.editForm.patrolType = this.editForm.patrolType + '';
                this.editFormVisible = true;
                this.selectRisk = row;
                HttpUtil.get('Riskitem/List', {riskNo: row.riskNo, pageno: 1, pagesize: 1000}).success((res) => {
                    this.riskContent = res.data;
                })
            },
            addTask: function () {
                var d = new Date();
                d.setHours(8)
                d.setMinutes(0)
                d.setSeconds(0)
                this.taskList.push({
                    group: [],
                    cycle: 1,
                    cycleType: '2',
                    startTime: d,
                    projectNo: SiteConfig.account.projectNo,
                    riskNo: this.selectRisk.riskNo,
                })
            },
            checkTime: function (i) {
                if (i < 10) {
                    i = "0" + i
                }
                return i;
            },
            select_status() {
                this.$forceUpdate();
            },
            saveTask: function (index) {
                if (this.taskList[index].group.length > 0) {
                    // this.taskList[index].group.push(SiteConfig.account.id);
                    this.taskList[index].group = this.taskList[index].group.join(',');
                    var date = new Date(this.taskList[index].startTime);
                    this.taskList[index].startTime = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + this.checkTime(date.getHours()) + ':' + this.checkTime(date.getMinutes()) + ':' + this.checkTime(date.getSeconds());
                    HttpUtil.get('Risk/addTask', this.taskList[index]).success((res) => {
                        if (res.state == 0) {
                            this.$message.success('创建成功');
                            this.taskVisible = false;
                        } else {
                            this.$message.error(res.errMsg);
                        }
                    })
                } else {
                    this.$message.error('请选择巡检人员');
                }
            },
            delTask: function (index) {
                if (this.taskList[index].Id) {
                    HttpUtil.get('Risk/deleteTask', {Id: this.taskList[index].Id}).success((res) => {
                        this.$message.success('删除成功');
                        this.taskList.splice(index, 1);
                    })
                } else {
                    this.taskList.splice(index, 1);
                }
            },
            checkTask: function (row) {
                this.taskDetailVisible = true;
                this.selectRisk = row;
                HttpUtil.get('Riskitem/List', {riskNo: this.selectRisk.riskNo,pagesize:200}).success((res) => {
                    this.riskItemArry = res.data;
                })
            },
            addRiskContent: function () {
                this.riskContent.push({
                    title: "", reason: '', damageType: '', scope: '0', damage: '', basis: '', controllMethod: ''
                });
            },
            getRisk: function (param) {
                param['projectNo'] = SiteConfig.account.projectNo;
                param.pagesize = 10;
                param.pageno = this.currentPage;
                HttpUtil.get('Risk/List', param).success((res) => {
                    this.tableData = res.data;
                    this.totalCount = res.total;
                });
            },
            taskCancel: function () {
                this.taskList = [];
                this.taskVisible = false;
            },
            addRisk: function () {
                this.form.projectNo = SiteConfig.account.projectNo;
                if (parseFloat(this.form.likelihood) && parseFloat(this.form.exposure) && parseFloat(this.form.consequence)) {
                    this.form.LecScore = this.form.likelihood * this.form.exposure * this.form.consequence;
                } else {
                    this.form.LecScore = 0
                }

                if (parseFloat(this.form.possible) && parseFloat(this.form.seriouse)) {
                    this.form.lsScore = this.form.possible * this.form.seriouse;
                } else {
                    this.form.lsScore = 0
                }

                if (this.form.LecScore >= 320) {
                    this.form.dangerGrade = 1;
                } else if (this.form.LecScore < 320 && this.form.LecScore >= 160) {
                    this.form.dangerGrade = 2;
                } else if (this.form.LecScore < 160 && this.form.LecScore >= 70) {
                    this.form.dangerGrade = 3;
                } else if (this.form.LecScore < 70 && this.form.LecScore > 0) {
                    this.form.dangerGrade = 4;
                } else {
                    this.form.dangerGrade = 0;
                }
                ;


                if (this.form.lsScore >= 20) {
                    this.form.riskGrade = 1;
                } else if (this.form.lsScore < 20 && this.form.lsScore >= 15) {
                    this.form.riskGrade = 2;
                } else if (this.form.lsScore < 15 && this.form.lsScore >= 8) {
                    this.form.riskGrade = 3;
                } else if (this.form.lsScore < 8 && this.form.lsScore > 0) {
                    this.form.riskGrade = 4;
                } else {
                    this.form.riskGrade = 0;
                }
                ;
                this.form.grade = this.form.dangerGrade > this.form.riskGrade ? this.form.dangerGrade : this.form.riskGrade;

                this.form.useFlag = 0;
                if (this.riskContent.length == 0) {
                    this.$message.warning('至少有一项风险内容');
                    return;
                }


                HttpUtil.post('Risk/Add', this.form).success((res) => {
                    let params = [];
                    for (let item of this.riskContent) {
                        if (item.title != '') {
                            item.riskNo = res.data;
                            params.push({
                                url: 'v1/Riskitem/Add',
                                type: 'get',
                                param: item
                            });
                        }
                    }
                    HttpUtil.when(params).success((res) => {
                        this.$message.success('创建成功');
                        this.riskCancel();
                        this.getRisk({});
                    })
                })
            },
            riskCancel: function () {
                this.addFormVisible = false;
                this.editFormVisible = false;
                this.riskContent = [];
                this.form = {
                    projectNo: '',
                    riskName: '',
                    riskType: '',
                    location: '',
                    manager: '',
                    patrolType: '',
                    NFCCardNo: '',
                    likelihood: '',
                    exposure: '',
                    consequence: '',
                    LecScore: '',
                    dangerGrade: '',
                    possible: '',
                    seriouse: '',
                    lsScore: '',
                    riskGrade: '',
                    grade: '',
                    riskStatus: 0,
                    riskDesc: '',
                };
                this.editForm = {
                    projectNo: '',
                    riskName: '',
                    riskType: '',
                    location: '',
                    manager: '',
                    patrolType: '',
                    NFCCardNo: '',
                    likelihood: '',
                    exposure: '',
                    consequence: '',
                    LecScore: '',
                    dangerGrade: '',
                    possible: '',
                    seriouse: '',
                    lsScore: '',
                    riskGrade: '',
                    grade: '',
                    riskStatus: 0,
                    riskDesc: '',
                };
            },
            delRiskContent: function (index) {
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    if (this.riskContent[index].Id) {
                        HttpUtil.get('Riskitem/Delete', {Id: this.riskContent[index].Id}).success((res) => {
                            this.riskContent.splice(index, 1);
                        })
                    } else {
                        this.$message({
                            type: 'error',
                            message: '无此内容Id'
                        });
                    }
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            isIntNum: function (val) {
                var regPos = / ^\d+$/; // 非负整数
                var regNeg = /^\-[1-9][0-9]*$/; // 负整数
                if (regPos.test(val) || regNeg.test(val)) {
                    return true;
                } else {
                    return false;
                }
            },
            editRisk: function () {
                this.editForm.projectNo = SiteConfig.account.projectNo;

                if (parseFloat(this.editForm.likelihood) && parseFloat(this.editForm.exposure) && parseFloat(this.editForm.consequence)) {
                    this.editForm.LecScore = this.editForm.likelihood * this.editForm.exposure * this.editForm.consequence;
                } else {
                    this.editForm.LecScore = 0;
                }

                if (parseFloat(this.editForm.possible) && parseFloat(this.editForm.seriouse)) {
                    this.editForm.lsScore = this.editForm.possible * this.editForm.seriouse;
                } else {
                    this.editForm.lsScore = 0
                }

                if (this.editForm.LecScore >= 320) {
                    this.editForm.dangerGrade = 1;
                } else if (this.editForm.LecScore < 320 && this.editForm.LecScore >= 160) {
                    this.editForm.dangerGrade = 2;
                } else if (this.editForm.LecScore < 160 && this.editForm.LecScore >= 70) {
                    this.editForm.dangerGrade = 3;
                } else if (this.editForm.LecScore < 70 && this.editForm.LecScore > 0) {
                    this.editForm.dangerGrade = 4;
                } else {
                    this.editForm.dangerGrade = 0;
                }
                ;

                if (this.editForm.lsScore >= 20) {
                    this.editForm.riskGrade = 1;
                } else if (this.editForm.lsScore < 20 && this.editForm.lsScore >= 15) {
                    this.editForm.riskGrade = 2;
                } else if (this.editForm.lsScore < 15 && this.editForm.lsScore >= 8) {
                    this.editForm.riskGrade = 3;
                } else if (this.editForm.lsScore < 8 && this.editForm.lsScore > 0) {
                    this.editForm.riskGrade = 4;
                } else {
                    this.editForm.riskGrade = 0;
                }
                ;
                this.editForm.grade = this.editForm.dangerGrade > this.editForm.riskGrade ? this.editForm.dangerGrade : this.editForm.riskGrade;
                HttpUtil.post('Risk/Update', this.editForm).success((res) => {
                    this.$message.success('保存成功');
                    this.riskCancel();
                    this.getRisk(this.searchForm);
                })
            },
            exportData: function (row) {
                HttpUtil.get('Risk/RiskExport', {riskNo: row.riskNo}).success((res) => {
                    this.$message.success('导出成功');
                    window.location = SiteConfig.webApiset + res.data;
                })
            },
            exportGrade: function (row) {
                HttpUtil.get('Patrolexcute/ExportRisk', {projectNo: SiteConfig.account.projectNo}).success((res) => {
                    this.$message.success('导出成功');
                    window.location = SiteConfig.webApiset + res.data;
                })
            },
            export_All: function () {
                HttpUtil.get('Patrolexcute/RiskExport', {projectNo: SiteConfig.account.projectNo}).success((res) => {
                    this.$message.success('导出成功');
                    window.location = SiteConfig.webApiset + res.data;
                })
            },
            exportDoc: function () {
                HttpUtil.get('Risk/RiskExportWord', {riskNo: this.selectRisk.riskNo}).success((res) => {
                    this.$message.success('导出成功');
                    window.location = SiteConfig.webApiset + res.data;
                })
            },
            delRisk: function (id) {
                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    HttpUtil.get('Risk/delete', {Id: id}).success((res) => {
                        this.$message({
                            type: 'success',
                            message: '删除成功!'
                        });
                        this.getRisk({});
                    })

                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            handleModClick: function () {
                this.modList()
                this.modVisible = true;
            },
            closeMod: function () {
                this.modVisible = false;
            },
            modSearch: function () {
                this.modList();
            },
            modChangePage: function (page) {
                this.modParam.currentPage = page;
                this.modList();
            },
            modList: function () {
                this.modForm.pagesize = this.modParam.pageSize;
                this.modForm.pageno = this.modParam.currentPage;
                HttpUtil.get('Risk/taskHistoryList', this.modForm).success((res) => {
                    this.modParam.totalCount = res.total;
                    this.modData = res.data;
                })
            },
            selectMod: function (index) {
                this.riskContent = [];
                this.form.riskType = this.modData[index].TitleData[0].riskType + '';
                this.form.riskName = this.modData[index].TitleData[0].riskName;
                for (let item of this.modData[index].TitleData)
                    this.riskContent.push({
                        title: item.title,
                        reason: item.reason,
                        damageType: item.damageType,
                        scope: item.scope,
                        damage: item.damage
                    });
                this.addFormVisible = true;
                this.modVisible = false;
            },
            getZone() {
                HttpUtil.get('Zone/List', {projectNo: SiteConfig.account.projectNo, pagesize: 200}).success((res) => {
                    this.zoneList = res.data;
                });
            }
        },
        created: function () {
            $('.page').show();
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            setTimeout(() => {
                loading.close();
                this.flag = true;
            }, 1000);
            let proNo = HttpUtil.getQueryString('projectNo');
            if (proNo) SiteConfig.account.projectNo = proNo;
            this.addFormVisible = false;
        },
        mounted: function () {
            this.headers = {
                uid: SiteConfig.account.uId,
                token: SiteConfig.account.accessToken
            }
            this.getRisk({});
            HttpUtil.get('User/Child', {parentId: SiteConfig.account.id}).success((r) => {
                for (let i in r.data) {
                    if (r.data[i].attributes.departmentName)
                        r.data[i].userName = r.data[i].userName + '-' + r.data[i].attributes.departmentName;

                    if (r.data[i].attributes.titlegrade!=null) {
                        r.data[i].Text = r.data[i].userName + '-';
                        r.data[i].Text +=
                            (r.data[i].attributes.titlegrade == 0 ? '公司级'
                                : r.data[i].attributes.titlegrade == 1 ? '分管领导级'
                                    : r.data[i].attributes.titlegrade == 2 ? '部门级'
                                        : r.data[i].attributes.titlegrade == 3 ? '车间级'
                                            : r.data[i].attributes.titlegrade == 4 ? '班组级'
                                                : r.data[i].attributes.titlegrade == 5 ? '岗位级' : '');
                    }

                }
                this.userList = r.data;
            });
            HttpUtil.get('Department/List', {projectNo: SiteConfig.account.projectNo, pagesize: 200}).success((res) => {
                this.departList = res.data;
            });
            this.getZone();
            HttpUtil.get('Risktitle/List', {projectNo: SiteConfig.account.projectNo}).success((res) => {
                this.LSdata = res.data[1];
                this.LECdata = res.data[0];
            });
            HttpUtil.get('CodeController/List', {pid: "Business"}).success((res) => {
                this.businessType = res.data;
            });
        }
    });
</script>
</body>
</html>
